package com.sxu.principles.demo3.old;

// 电脑类进行对Cpu、硬盘、内存进行组合
public class Computer {
    private XiJieHardDisk xiJieHardDisk;
    private IntelCpu intelCpu;
    private KingstonMemory kingstonMemory;

    public XiJieHardDisk getXiJieHardDisk() {
        return xiJieHardDisk;
    }

    public void setXiJieHardDisk(XiJieHardDisk xiJieHardDisk) {
        this.xiJieHardDisk = xiJieHardDisk;
    }

    public IntelCpu getIntelCpu() {
        return intelCpu;
    }

    public void setIntelCpu(IntelCpu intelCpu) {
        this.intelCpu = intelCpu;
    }

    public KingstonMemory getKingstonMemory() {
        return kingstonMemory;
    }

    public void setKingstonMemory(KingstonMemory kingstonMemory) {
        this.kingstonMemory = kingstonMemory;
    }

    public void run(){
        System.out.println("Computer is running");
        String data = xiJieHardDisk.read();
        System.out.println("读取到数据"+data);
        intelCpu.run();
        kingstonMemory.save();
    }
}
